#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'arrow'
__explain__ = ''


from AvCarrier.celery import app
from av_editor.models import MaterialFile
from av_editor.moviepy.video_templates.template_ytb import make_t1_video, make_t2_video


@app.task(bind=True, time_limit=12 * 3600)
def make_video_t1(self, data):
    right_video_id = data.get("right_video")
    left_image_id = data.get("left_image")
    bottom_image_id = data.get("bottom_image")
    right_video_path = MaterialFile.objects.get(id=right_video_id).get_file_path()
    left_image_path = MaterialFile.objects.get(id=left_image_id).get_file_path()
    bottom_image_path = MaterialFile.objects.get(id=bottom_image_id).get_file_path()
    make_t2_video(right_video_path, left_image_path, bottom_image_path)